:ruby
  area_unit = Nomen::Unit[:hectare]
  if @campaigns
    campaign = @campaigns
    activities = Activity.of_campaign(campaign).of_families(:plant_farming).order(:id)
  end

- if campaign && activities.any?
  :ruby
    # In theory, @activity and @productions should be produced here from @campaign only
    activities_serie = activities.collect do |activity|
      {name: activity.name, y: activity.support_shape_area(campaign, unit: area_unit.name).to_s.to_f, id: activity.id, url: backend_activity_path(activity), color: activity.color }
    end

    productions = ActivityProduction.of_campaign(campaign).of_activities(activities)

    productions_net_surface_area = productions.includes(:activity, :cultivable_zone).map(&:support_shape_area).compact.sum.in(area_unit.name).round(3).l

    productions_serie = productions.order("activity_id, id").collect do |production|
      {name: production.name, y: production.support_shape_area(area_unit.name).to_s.to_f, url: backend_activity_production_path(production), color: production.color } #ligthen(activities_serie.detect{|a| a[:id] == production.activity_id}[:color], 0.3)
    end

    series = []
    series << {name: Activity.model_name.human, data: activities_serie, size: "60%", data_labels: {enabled: false}}
    series << {name: ActivityProduction.model_name.human, data: productions_serie, size: "80%", inner_size: "60%", data_labels: {enabled: true}}

  = pie_highcharts(series, tooltip: {point_format: "{point.y: 1.2f} #{area_unit.symbol}"}, title: "#{campaign.name} – #{productions_net_surface_area}".html_safe, plot_options: { pie: { allow_point_select: true, cursor: 'pointer'}})
- else
  = no_data
